This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
RE: how can i find only those document which are having responses? ~Bill Quetfoochekakol 23.Dec.03 08:58 AM a Web browser Applications Development All ReleasesAll Platforms
Unfortunately not. Only the response documents know about their parent document (via the $ref field), not the other way around.
You essentially have three options:
1. Iterate over all potential response parent (main) documents, and check the notesDocument.responses.count property, and build the collection manually of those with count > 0.
2. Similar to 1, but iterating over all responses in a view categorized by @Text($REF), and build a collection of main documents (retrieve parent via notesDocument.parentDocumentUnid.
3. Whenever a response document is created, (saved) mark the parent (main) document with a "hasResponses" field (only set this field if not already set, to avoid excesive save/replication conflicts. You will have to consider whether you need to also reset this field when removing response documents. Now you ca make a simple view of main documents with the hasResponses field set.